<!-- xml version="1.0" encoding="utf-8" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<title>De Bello Gallico</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link href="../flashcard.css" rel="stylesheet" type="text/css">
</head>


<script type="text/javascript">
var sentences = [
  [ ["Relinquebatur", "una", "per", "Sequanos", "via,", "qua", "Sequanis", "invitis", "propter", "angustias", "ire", "non", "poterant."],
    ["There-was-left", "one", "through", "Sequani", "way,", "by-which", "Sequani", "unwilling", "on-account-of", "narrowness", "to-go", "not", "they-were-able."] ],
  [ ["His", "cum", "sua", "sponte", "persuadere", "non", "possent,", "legatos", "ad", "Dumnorigem", "Aeduum", "mittunt,"],
    ["On-these", "since", "by-their-own", "influence", "to-prevail", "not", "they-were-able,", "legates", "to", "Dumnorix", "Aeduan", "they-send,"] ],
  [ ["ut", "eo", "deprecatore", "a", "Sequanis", "impetrarent."],
    ["that", "he", "[being]_advocate", "from", "Sequani", "they-might-obtain."] ],
  [ ["Dumnorix", "gratia", "et", "largitione", "apud", "Sequanos", "plurimum", "poterat,", "et", "Helvetiis", "erat", "amicus,"],
    ["Dumnorix", "by-popularity", "and", "largess", "among", "Sequani", "[the]-most", "could,", "and", "to-Helvetii", "was", "friend,"] ],
  [ ["quod", "ex", "ea", "civitate", "Orgetorigis", "filiam", "in", "matrimonium", "duxerat,"],
    ["because", "out-of", "that", "state", "Orgetorix’", "daughter", "in", "marriage", "he-had-led,"] ],
  [ ["et", "cupiditate", "regni", "adductus", "novis", "rebus", "studebat", "et", "quam", "plurimas", "civitates", "suo", "beneficio", "habere", "obstrictas", "volebat."],
    ["and", "by-desire", "of-supreme-power", "to-led", "for-new", "things", "was-eager", "and", "(as)", "most-possible", "states", "by-his-own", "good-deed", "to-hold", "bound", "he-wished."] ],
  [ ["Itaque", "rem", "suscipit", "et", "a", "Sequanis", "impetrat,"],
    ["Therefore", "[the]-affair", "he-undertakes", "and", "from", "Sequani", "he-obtains,"] ],
  [ ["ut", "per", "fines", "suos", "Helvetios", "ire", "patiantur,", "obsidesque", "uti", "inter", "sese", "dent", "perficit:"],
    ["that", "through", "territories", "their-own", "Helvetii", "to-go", "they-allow,", "hostages-also", "that", "among", "themselves", "they-give", "he-brings-about:"] ],
  [ ["Sequani,", "ne", "itinere", "Helvetios", "prohibeant;", "Helvetii,", "ut", "sine", "maleficio", "et", "iniuria", "transeant."],
    ["Sequani,", "that-not", "on-march", "Helvetii", "they-hinder;", "Helvetii,", "that", "without", "wrong-doing", "and", "injury", "they-through-pass."] ]
];

var i = 0;
var j = 0;

var shown = 0;

function updateVoc() {
	
	var sentence = "";
	
	for(n = 0; n < sentences[i][0].length; n++) {
		if (n == j) {
			sentence += ' <span class="curword">' + sentences[i][0][n] + "</span>";
		} else {
			sentence += " " + sentences[i][0][n];
		}
	}
	
	document.getElementById('v3').innerHTML = sentence;
	
	if (shown == 0) {
		document.getElementById('v1').innerHTML = "";
	} else {
		document.getElementById('v1').innerHTML = sentences[i][1][j];
	}
}

function next() {
	shown++;
	if (shown > 1) {
		shown = 0;
		j++;
		if (j >= sentences[i][0].length) {
			j = 0;
			i++;
			if (i >= sentences.length) {
				i = 0;
				alert('All done!');
			}
		}
	}
	updateVoc();
}

function prev() {
	shown--;
	if (shown < 0) {
		shown = 1;
		j--;
		
		if (j < 0) {
			i--;
			if (i < 0) {
				i = sentences.length - 1;
				alert('All done!');
			}
			j = sentences[i][0].length - 1;
		}
	}
	
	updateVoc();
}

</script>

<body onload="updateVoc()">
<h1 style="text-align:center; color: #60B0C0;">Liber I - Caput IX</h1>

<div class="center">
<div id="v3" class="v3"></div>
<div id="v2" class="v2">&nbsp;</div>
<div id="v1" class="v1"></div>


<a href="#" class="button" id="btnprev" onclick="prev()" accesskey="p">&lt;&lt;</a>
<a href="#" class="button" id="btnnext" onclick="next()" accesskey="n">&gt;&gt;</a>


</div>
</body>
</html>
